Pipeline metaphor: Source (recipe) โ Build (cook the dish) โ Test (taste it) โ Deploy (serve it). CodePipeline is the kitchen manager ensuring each step happens in order.
appspec.yml: Defines deployment lifecycle hooks โ BeforeInstall, AfterInstall, ApplicationStart, ValidateService. Use hooks for health checks and rollback triggers.
๐ CloudFormation Advanced
Nested Stacks: Break large templates into reusable components (network, compute, database)
StackSets: Deploy stacks across multiple accounts and Regions from a single template
Change Sets: Preview changes before applying โ see what will be added/modified/deleted
CDK vs. CloudFormation: CDK is to CloudFormation what TypeScript is to raw JSON โ same underlying engine, but with programming language power, abstractions, and type safety.
Q1: A team needs to deploy the same security configuration across 200 accounts in an Organization. Which CloudFormation feature should they use?
A) Nested Stacks B) Change Sets C) StackSets with SERVICE_MANAGED permissions D) Custom Resources
C) StackSets with SERVICE_MANAGED permissions โ StackSets deploy stacks across multiple accounts and Regions. SERVICE_MANAGED permissions integrates with Organizations for automatic deployment to new accounts.
Q2: Which CodeDeploy strategy provides the fastest rollback for ECS deployments?
A) Rolling B) AllAtOnce C) Blue/Green D) In-place
C) Blue/Green โ Blue/Green keeps the old task set running alongside the new one. Rollback is instant (re-route traffic back to blue). No need to redeploy the previous version.